<template>
  <body>
  <div class='card'>
    <div class="imgBox">
<!--      <img src="https://cdn.pixabay.com/photo/2016/03/15/18/12/forest-1258845_1280.jpg">-->
      <img src="../assets/monkeys/monkeyKing.jpg" id="book">
    </div>
    <div class='details'>
    <img :src=this.src id="king">
    </div>
  </div>

  </body>
</template>

<script>
import Vue from "vue";

export default {
  name: "ShowKing",
  data () {
    return {
      src: "",
      all_users:[]
    }
  },
  mounted() {
    this.$data.all_users = JSON.parse(localStorage.getItem("all_users"))
    for(let i=0;i<this.$data.all_users.length;i++){
      let user = JSON.parse(this.$data.all_users[i])
      if(user.account===this.$user_account){
        console.log(user['monkeyKing'])
        this.src = require(`../images/monkey${user['monkeyKing']%8}.png`)
        break
      }
    }
  }
}
</script>

<style>
body {
  margin: 0;
  padding: 0;
  background:url('../assets/monkeys/kingBGP.jpg') no-repeat;
  background-size: 100% 100%;
}

#book {
  width: 100%;
  height: 100%;
}
#king{
  width: 100%;
  height: 100%;
}

.card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 400px;
  background: #fff;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) perspective(2000px);
  box-shadow: inset 300px 0 50px rgba(0, 0, 0, 0.5), 0 20px 100px rgba(0, 0, 0, 0.5);
  transition: 1s;
}

.card:hover {
  transform: translate(-50%, -50%) perspective(2000px) rotate(-10deg);
  box-shadow: inset 20px 0 50px rgba(0, 0, 0, 0.5), 0 10px 100px rgba(0, 0, 0, 0.5);
}

.card::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 0;
  width: 100%;
  height: 5px;
  z-index: 10;
  background: #475b02;
  transform: skewX(-45deg);
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  right: -5px;
  width: 5px;
  height: 100%;
  background-color: #7ea301;
}

.card .imgBox {
  user-select: none;
  width: 100%;
  height: 100%;
  position: relative;
  transform-origin: left;
  transition: 1s cubic-bezier(.15, 1.7, .84, .58);

}

.card:hover .imgBox {
  transform: rotateY(-155deg);
}

.card .details {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  padding: 20px;
  z-index: -1;
}
</style>
